package com.naiterui.ehp.bs.b2c.product.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Entity
@NoArgsConstructor
@Table(name = "p_sku_image")
public class SkuImage implements java.io.Serializable {
    private static final long serialVersionUID = -4641266825839036854L;
    /**
     * 大图
     */
    public static final int TYPE_BIG = 1;
    /**
     * 缩略图
     */
    public static final int TYPE_THUMB = 2;
    /**
     * ICON
     */
    public static final int TYPE_ICON = 3;
    /**
     * 大图尺寸
     */
    public static final String TYPE_BIG_SIZE = "800X800";
    /**
     * 缩略图尺寸
     */
    public static final String TYPE_THUMB_SIZE = "400X400";
    /**
     * ICON尺寸
     */
    public static final String TYPE_ICON_SIZE = "100X100";
    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    /**
     * 商品id
     */
    @Column(name = "sku_id", nullable = false)
    private Long skuId;

    /**
     * 文件路径
     */
    @Column(name = "path", nullable = false)
    private String path;

    /**
     * 文件类型 1：大图 2：缩略图 3:icon
     */
    @Column(name = "type", nullable = false)
    private Integer type;

    /**
     * 创建时间
     */
    @Column(name = "created_at", nullable = false)
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by", nullable = false)
    private String createdBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at", nullable = false)
    private Date changedAt;

    /**
     * 修改人
     */
    @Column(name = "changed_by", nullable = false)
    private String changedBy;

    /**
     * 乐观锁
     */
    @Version
    @Column(name = "version", nullable = false)
    private Integer version;

}
